Optimal. Leaf size=156 \[ \frac {a^3 (6 A+7 B+5 C) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {(6 A-3 B-5 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{6 d}+a^3 x (3 A+B)+\frac {5 a^3 (B+C) \tan (c+d x)}{2 d}-\frac {(3 A-C) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 a d}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^3}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.28, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4086, 3917, 3914, 3767, 8, 3770} \[ \frac {a^3 (6 A+7 B+5 C) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {(6 A-3 B-5 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{6 d}+a^3 x (3 A+B)-\frac {(3 A-C) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{3 a d}+\frac {5 a^3 (B+C) \tan (c+d x)}{2 d}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^3}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 3914
Rule 3917
Rule 4086
Rubi steps
\begin {align*} \int \cos (c+d x) (a+a \sec (c+d x))^3 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {A (a+a \sec (c+d x))^3 \sin (c+d x)}{d}+\frac {\int (a+a \sec (c+d x))^3 (a (3 A+B)-a (3 A-C) \sec (c+d x)) \, dx}{a}\\ &=\frac {A (a+a \sec (c+d x))^3 \sin (c+d x)}{d}-\frac {(3 A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 a d}+\frac {\int (a+a \sec (c+d x))^2 \left (3 a^2 (3 A+B)-a^2 (6 A-3 B-5 C) \sec (c+d x)\right ) \, dx}{3 a}\\ &=\frac {A (a+a \sec (c+d x))^3 \sin (c+d x)}{d}-\frac {(3 A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 a d}-\frac {(6 A-3 B-5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{6 d}+\frac {\int (a+a \sec (c+d x)) \left (6 a^3 (3 A+B)+15 a^3 (B+C) \sec (c+d x)\right ) \, dx}{6 a}\\ &=a^3 (3 A+B) x+\frac {A (a+a \sec (c+d x))^3 \sin (c+d x)}{d}-\frac {(3 A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 a d}-\frac {(6 A-3 B-5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{6 d}+\frac {1}{2} \left (5 a^3 (B+C)\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{2} \left (a^3 (6 A+7 B+5 C)\right ) \int \sec (c+d x) \, dx\\ &=a^3 (3 A+B) x+\frac {a^3 (6 A+7 B+5 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {A (a+a \sec (c+d x))^3 \sin (c+d x)}{d}-\frac {(3 A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 a d}-\frac {(6 A-3 B-5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{6 d}-\frac {\left (5 a^3 (B+C)\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{2 d}\\ &=a^3 (3 A+B) x+\frac {a^3 (6 A+7 B+5 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {A (a+a \sec (c+d x))^3 \sin (c+d x)}{d}+\frac {5 a^3 (B+C) \tan (c+d x)}{2 d}-\frac {(3 A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{3 a d}-\frac {(6 A-3 B-5 C) \left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 6.47, size = 1503, normalized size = 9.63 \[ \text {result too large to display} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.48, size = 168, normalized size = 1.08 \[ \frac {12 \, {\left (3 \, A + B\right )} a^{3} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (6 \, A + 7 \, B + 5 \, C\right )} a^{3} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (6 \, A + 7 \, B + 5 \, C\right )} a^{3} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (6 \, A a^{3} \cos \left (d x + c\right )^{3} + 2 \, {\left (3 \, A + 9 \, B + 11 \, C\right )} a^{3} \cos \left (d x + c\right )^{2} + 3 \, {\left (B + 3 \, C\right )} a^{3} \cos \left (d x + c\right ) + 2 \, C a^{3}\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.41, size = 288, normalized size = 1.85 \[ \frac {\frac {12 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 6 \, {\left (3 \, A a^{3} + B a^{3}\right )} {\left (d x + c\right )} + 3 \, {\left (6 \, A a^{3} + 7 \, B a^{3} + 5 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (6 \, A a^{3} + 7 \, B a^{3} + 5 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 21 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 33 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.57, size = 226, normalized size = 1.45 \[ \frac {a^{3} A \sin \left (d x +c \right )}{d}+a^{3} B x +\frac {a^{3} B c}{d}+\frac {5 C \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+3 a^{3} A x +\frac {3 A \,a^{3} c}{d}+\frac {7 a^{3} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {11 a^{3} C \tan \left (d x +c \right )}{3 d}+\frac {3 A \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {3 a^{3} B \tan \left (d x +c \right )}{d}+\frac {3 C \,a^{3} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {A \,a^{3} \tan \left (d x +c \right )}{d}+\frac {a^{3} B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {C \,a^{3} \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 274, normalized size = 1.76 \[ \frac {36 \, {\left (d x + c\right )} A a^{3} + 12 \, {\left (d x + c\right )} B a^{3} + 4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{3} - 3 \, B a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 9 \, C a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 18 \, A a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 18 \, B a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, C a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, A a^{3} \sin \left (d x + c\right ) + 12 \, A a^{3} \tan \left (d x + c\right ) + 36 \, B a^{3} \tan \left (d x + c\right ) + 36 \, C a^{3} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.44, size = 523, normalized size = 3.35 \[ \frac {\frac {A\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {A\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {A\,a^3\,\sin \left (4\,c+4\,d\,x\right )}{8}+\frac {B\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {3\,B\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {3\,C\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {11\,C\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{12}+\frac {A\,a^3\,\sin \left (c+d\,x\right )}{4}+\frac {3\,B\,a^3\,\sin \left (c+d\,x\right )}{4}+\frac {5\,C\,a^3\,\sin \left (c+d\,x\right )}{4}+\frac {9\,A\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {9\,A\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {3\,B\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {21\,B\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}+\frac {15\,C\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}+\frac {3\,A\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {3\,A\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {B\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {7\,B\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{4}+\frac {5\,C\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{4}}{d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a^{3} \left (\int A \cos {\left (c + d x \right )}\, dx + \int 3 A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 A \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 B \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int C \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 C \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 C \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int C \cos {\left (c + d x \right )} \sec ^{5}{\left (c + d x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________